package cn.yl.pay.service.service.feign;

import cn.yl.pay.service.entity.PayOrderRecord;
import cn.yl.pay.service.entity.PayOrderVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient("edu-order-boot")
public interface UserCourseOrderFeignService {

    @GetMapping("order/getMyCourseOrderById")
    Map<String, String> getMyCourseOrderById(@RequestParam Integer userId,@RequestParam Integer courseId,@RequestParam Integer sourceType);

    @PutMapping("payOrder/saveOrder")
    void saveOrder(@RequestBody PayOrderVo payOrderVo);

    @PutMapping("payOrder/{orderId}/{status}")
    Map<String,String> updateByStatus(@PathVariable String orderId, @PathVariable Integer status);

    @GetMapping("payOrder/getCurrentPrice/{orderId}")
    BigDecimal getCurrentPrice(@PathVariable String orderId);

    @PutMapping("payOrderRecord/savePayOrderRecord")
    void savePayOrderRecord(@RequestBody PayOrderRecord payOrderRecord);

    @PostMapping("payOrder/getPayOrder/{orderId}")
    Map<String ,String> getPayOrder(@PathVariable String orderId);

    /**
     * @param time 提前时间
     * @return 已经过期的 orderIdList
     */
    @GetMapping("order/timeOutOrderIdList/{time}")
    List<String> timeOutOrderIdList(@PathVariable Integer time);
}
